package com.mj;

public class Stack <E> {
  ArrayList<E> list = new ArrayList<>(10);
  
  public void clear() {
	list.clear();
  }
  
  public int size() {
	  return list.size();
  }
  
  public boolean isEmpty() {
	  return list.isEmpty();
  }
  
  public void push(E element) {
	  list.add(element);
  }
 
  public E pop() {
	return list.remove(size() - 1);
  }
  
  public E top() {
	return list.get(size() - 1);
  }
  
  
}
